<?php

/**
 * Description of o2orent
 *
 * @author libaoling
 * @time 2014-12-20
 */
class O2orentModel extends BaseModel
{
    var $table  = 'o2o_rent';
    var $prikey = 'rent_id';
    var $_name  = 'o2orent';
    
    function unique_rent_no($rent_no, $rent_id = 0)
    {
        $conditions = "rent_no = '" . $rent_no . "'";
        $rent_id && $conditions .= " AND rent_id <> '" . $rent_id . "'";
        return count($this->find(array('conditions' => $conditions))) == 0;
    }
}
